program Lines;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  ArrInt = array of integer;

var
  fin: TextFile;
  mass, mass1: array of ArrInt;
  i, n, k, j: integer;
  flag: boolean;

begin
  k:=0;
  assignFile (fin, 'input.txt');
  reset (fin);
  read (fin, n);
  setlength (mass, n);
  for i:= 0 to n do
    setlength (mass[i], 4);
  for i:= 0 to n-1 do
    begin
      read (fin, mass[i][0]);
      read (fin, mass[i][1]);
      read (fin, mass[i][2]);
      read (fin, mass[i][3]);
    end;
  setlength (mass1, round((n*(n-1))/2));
  for i:=0 to 1 do
    setlength (mass[i], 2);
  for i:= 0 to (n-1) do
    for j:= (i+1) to (n-1) do
    begin
      mass1[i*(n-1)+j][0]:=round(((mass[j][2]-mass[j][0])*(mass[i][0]*mass[i][3]-mass[i][2]*mass[i][1])-(mass[i][2]-mass[i][0])*(mass[j][0]*mass[j][3]-mass[j][2]*mass[j][1]))/((mass[i][2]-mass[i][0])*(mass[j][1]-mass[j][3])-(mass[j][2]-mass[j][0])*(mass[i][1]-mass[i][3])));
      mass1[i*(n-1)+j][1]:=round(((mass[j][1]-mass[j][3])*(mass[i][0]*mass[i][3]-mass[i][2]*mass[i][1])-(mass[i][1]-mass[i][3])*(mass[j][0]*mass[j][3]-mass[j][2]*mass[j][1]))/(-(mass[i][2]-mass[i][0])*(mass[j][1]-mass[j][3])-(mass[j][2]+mass[j][0])*(mass[i][1]-mass[i][3])));
    end;
  for i:=0 to round((n*(n-1))/2) do
    if (mass1[i][0]=0) and (mass1[i][1]=0) then
      k:=k+1;
  for i:= 0 to (n-1) do
    begin
      flag:= true;
      for j:= (i+1) to (n-1) do
      begin
        if (mass1[i][0]=0) or (mass1[i][0]=mass1[j][0]) or (mass1[i][1]=0) or (mass1[i][1]=mass1[j][1]) then
          begin
            flag:= false;
            mass1[i][0]:=0;
            mass1[i][1]:=0;
          end;
      end;
      if (flag) then
        k:=k+1;
    end;
  closeFile (fin);
  writeln (k);
  readln;
end.
